home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10319 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  34 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
  5. Message-ID: <1996Mar16.175143.10948@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <314ad16d.86316693@news>
  11. Date: Sat, 16 Mar 1996 17:51:43 GMT
  12.  
  13. In article <314ad16d.86316693@news>, mao@tiac.net (Mark A. Odell) writes:
  14. >On Fri, 15 Mar 1996 18:33:02 GMT, szh@zcon.com (Syed Zaeem Hosain) wrote:
  15. >
  16. >>In article <3148DBB6.1353@hawaii.edu>, Dave Carien <davec@hawaii.edu> writes:
  17. >>>Yes or no on this, I just recently got confused by two different books. I 
  18. >>>assume that the declaration foo[80] allocates storage for elements 0-79.
  19. >
  20. >// Yes. This works nice and safely for any array of known size.
  21. >foo[sizeof(foo)-1] = '\0';
  22.  
  23. Uhhh ... careful with your editing, please! I did not say the above.
  24. My response was a simple "Y" as the original poster requested.
  25.  
  26.                                 Z
  27.  
  28.  
  29. -- 
  30. -------------------------------------------------------------------------
  31. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  32. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  33. -------------------------------------------------------------------------
  34.